home *** CD-ROM | disk | FTP | other *** search
/ Macwelt 1 / Macwelt DVD 1.toast / Web-Publishing / HTML-Editoren / Alpha ƒ / Help / Matlab Help < prev    next >
Encoding:
Text File  |  2000-08-23  |  11.0 KB  |  120 lines

  1.  
  2. Matlab Help
  3.  
  4.                                                version: 2.0.2
  5.                                                created: 06/13/95 {02:27:55 am}
  6.                                            last update: 08/23/00 {03:39:54 pm}
  7.  
  8.  
  9. This is a set of TCL proc's that allow the shareware Macintosh text editor
  10. Alpha to act as a front end for MATLAB for Macintosh version 5.0 or higher. 
  11. Requires Alpha 7.0 or higher.  Some features will work with MATLAB 4.2c, but
  12. you should upgrade to MATLAB 5 to avoid the a serious bug in MATLAB 4.2c as
  13. described below.
  14.  
  15.  
  16.           Main Features
  17.  
  18.  
  19. • Syntax coloring of keywords
  20. • Automatic line indentation
  21. • Shell like command window for typing in MATLAB commands
  22. • Command history window for easy reissuing of commands
  23. • "Save and Go" for executing m-files
  24. • Execute line or selection sends command(s) to MATLAB
  25. • Get help or open files by selecting or Cmd-double clicking commands
  26. • Debug menu for easy use of MATLAB debugging
  27. • Workspace menu for easy management of the MATLAB workspace
  28. • Can automatically clear old function from workspace when saving file
  29. • Utility to create HTML documentation of MATLAB files
  30.  
  31. A "MATLAB Example" syntax file is available for exploring the MATLAB 
  32. mode's features and menu.
  33.  
  34.  
  35.           WARNING
  36.  
  37.  
  38. There is a bug in MATLAB 4.2c that will cause MATLAB to crash if the return
  39. string from a dosc apple event is large.  Since MATLAB mode uses the dosc
  40. event to talk to MATLAB you should not execute MATLAB scripts from Alpha (or
  41. Apple Scripts for that matter) that will print large results to the screen. 
  42. So, for example, don't do this
  43.  
  44. » 1:1000
  45.  
  46. As far as I know there is nothing I can do to prevent this from happening.  
  47.  
  48. This bug has been fixed in MATLAB 5.
  49.  
  50.           
  51.     ----------------------------------------------------------------------
  52.  
  53.  
  54.           Editing matlab files
  55.  
  56.  
  57. If you open any text file with a .m extension, Alpha will automatically
  58. recognize it as a MATLAB file and set the current mode to be MATL. You type
  59. in your MATLAB code as you normally would, but matlabMode helps you in
  60. several ways.  It will color certain key words.  You can easily change the
  61. coloring scheme in the the "Config --> Mode Prefs --> Preferences" menu item.
  62.  
  63. As you type you may notice some strange behavior.  If you hit return, the
  64. next line will be automatically indented for you according to the previous
  65. lines indentation and the block structure.  You can turn off this feature by
  66. unselecting "electricReturn" in the mode flags.  In addition if you type a
  67. semicolon ";", matlabMode will automatically hit return for you.  You can
  68. turn off this feature by unselecting "electricSemi" in the mode flags.
  69.  
  70. Once you are finished editing the MATLAB file you can select "saveAndExecute"
  71. from the MATLAB menu to send the file to MATLAB for execution.  The results
  72. will be shown in the command window within Alpha.  If you only want to
  73. execute part of the file simply select the code you want and then choose
  74. executeSelection from the MATLAB menu.
  75.  
  76. If there is a matlab file in your code that you wish to edit you can easily
  77. open several ways.  One is to select the name and the choose "openSelection"
  78. from the MATLAB menu.  Another way is to Hold down the cmd (splat, apple,...) 
  79. key and double click on the matlab command.  This will bring up help on that
  80. command.  Hold down both the cmd and control keys and double click to edit
  81. the m-files.  The mode variable DblClickEdits (which can be changed using the
  82. "Mode Prefs --> Preferences" menu item) will reverse this behavior.
  83.  
  84.  
  85.           Command window
  86.  
  87. This acts similar to the command window in MATLAB. Simply type in a command
  88. at the prompt and hit return to have it executed in MATLAB. Use the up and
  89. down arrow keys to recall previous commands.  Hit control-u to cancel the
  90. current line.
  91.  
  92.  
  93.           Command history window
  94.  
  95. This acts similar to the history window in MATLAB: it contains a list of all
  96. previous commands entered in the command window.  Commands sent from m-files
  97. are not added.  Use the arrow keys to navigate up or down and hit return to
  98. reissue the command.
  99.  
  100.  
  101.           Cmd-Double Clicking
  102.  
  103. Hold down the cmd (splat, apple,...)  key and double click on a matlab
  104. command.  This will bring up help on that command.  Hold down both the cmd
  105. and control keys and double click to edit the m-files depending.  The mode
  106. variable DblClickEdits (see the "Config --> Mode Prefs --> Preferences" menu
  107. item) will reverse this behavior.
  108.  
  109.           Menu Items
  110.             
  111.                Matlab Menu
  112.  
  113. switchToMatlab       Swap the process to matlab, launching if necessary
  114.  
  115. commandWindow        Open command window
  116.  
  117. commandHistory       Open history window
  118.  
  119. editInMatlab         Close and edit current window in Matlab
  120.  
  121. executeSelection     Execute selection in Matlab; if nothing is selected
  122.                      execute current line
  123.  
  124. saveAndExecute       Save and execute current window
  125.  
  126. openSelection        Open m-files of selection
  127.  
  128.  
  129.                Command Help Menu
  130.  
  131. normalHelp           Presents a dialog box for entering in a command to ask
  132.                      MATLAB for help on.
  133.                             
  134. helpSelection        Get help on selected command in current window
  135.  
  136. searchDocumentation  Search for help on a keyword
  137.  
  138. makeDocumentation    Create HTML documentation for a folder of m-files
  139.  
  140.  
  141.                Workspace Menu
  142.  
  143. rebuildPath          Sends a "path(path)" to MATLAB
  144.  
  145. addToPath            Get the path of current window and add it to MATLAB's path
  146.  
  147. cdToWin              Set current directory to the folder of the current window
  148.  
  149. clearWorkspace       Sends a "clear" to MATLAB
  150.  
  151. clearProcedure       Removes current window's function from the workspace
  152.                      ("clear m-file").
  153.                             
  154. closeAll             Closes all MATLAB figure windows ("close all")                        
  155.  
  156.                Debug Menu
  157.  
  158. debugInMatlab        Opens the debug window in MATLAB for current window
  159.  
  160. stopIfError          Sends "dbstop if error" to MATLAB
  161.  
  162. stopInFile           Sends "dbstop in m-file" to MATLAB
  163.  
  164. stopAtCurrentLine    Sends  "dbstop at current-line in m-file" to MATLAB
  165.  
  166. stepOneLine          Sends "dbstep 1" to MATLAB
  167.  
  168. clearAllBreakpoints  Sends "dbclear all" to MATLAB
  169.  
  170. fileBreakpoints      Sends "dbstatus m-file" to MATLAB
  171.  
  172. openErrorFile        Opens the offending file if an error occurred on the 
  173.                      last command.
  174.  
  175.                Quick Options Menu
  176.             
  177. clearOnSave          If selected sends a "clear functionName" to MATLAB when
  178.                      saving a file.  Useful when the function is a callback and 
  179.                             MATLAB doesn't check if it has changed.
  180.                             
  181. webHelp              All help commands open up the HTML help file if available
  182.  
  183.  
  184.                             
  185.                Non-Menu Key Bindings
  186.  
  187. *All windows*
  188.  
  189. opt-;       Electric semicolon with jump to next stop
  190.  
  191. *Command Window Only*
  192.  
  193. return       Execute current command line in Matlab
  194. up arrow     Recall Previous Command
  195. down arrow   Recall Next Command
  196. control-u    Cancel Line
  197.  
  198. *m-files Window Only*
  199.  
  200. control-return  Execute current line in Matlab
  201.  
  202.  
  203.                Electric Completions
  204.  
  205.  
  206. matlabMode supports electric completions for switch, while, and for.
  207.  
  208.  
  209.     ----------------------------------------------------------------------
  210.  
  211.           Customization
  212.  
  213.  
  214. Here are some things you can set via the "Config --> Mode Prefs --> Preferences"
  215. menu item:
  216.  
  217.    1. Change the name of the command window
  218.    2. Change the name command history window
  219.    3. Toggle the behavior of Cmd-Double Clicking.
  220.    4. Set the color of the different kinds of keywords.
  221.    5. Turn off electric semicolon
  222.    6. Turn off auto-indentation (elecReturn)
  223.     7. Turn off warning that Matlab is busy (queEventsQuietly)
  224.     8. Use web browser to view help files or use normal Matlab help
  225.     9. Automatically send a clear function command to Matlab when saving a file
  226.    
  227. In addition if you want to add menu items you can define a proc in a
  228. "MATLPrefs.tcl" file called matDummyMenuItem and then simply add items to the
  229. matlab menu without having to modify "matlabMode.tcl".  For example:
  230.  
  231.     addMenuItem $MATLMenu     "(-"
  232.     addMenuItem $MATLMenu  "stephen"
  233.     
  234.     proc matDummyMenuItem {menu item} {
  235.         global MATLMenu
  236.         switch $menu $MATLMenu {
  237.             switch $item {
  238.                 stephen   {insertText "Smart guy"}
  239.             }
  240.         }
  241.     }
  242.  
  243.           
  244.     ----------------------------------------------------------------------
  245.  
  246.           Version History
  247.  
  248.  
  249.                Changes in Version 2.0
  250.  
  251. • sendURL changed back to sendURL
  252. • added debugInMatlab
  253. • added a few completions
  254.  
  255.                Changes in Version 2.0b3
  256.  
  257. • sendUrl changed to sendURL
  258. • Fixed mode setting for command and history windows
  259.  
  260.                Changes in Version 2.0b2
  261.  
  262. • Added a queue of events sent to Matlab
  263. • Removed waitForResults as events are now queued
  264.  
  265.                Changes in Version 2.0b1
  266.  
  267. • Made compatible with Alpha 7.0b2
  268. • Removed Electric Alias Support (no longer in Alpha)
  269. • Broke source into many files
  270. • Added makeDocumentation to make HTML docs from m-files
  271.  
  272.                Changes in Version 1.4
  273.  
  274. • Added MATLMarkFile
  275. • Added auto-indentation
  276. • Electric Alias Support
  277. • Electric Semicolon
  278. • Added MATLAB HTML help
  279. • Added option to clear function on save
  280. • Added option to not wait for results
  281.  
  282.                Changes in Version 1.3
  283.  
  284. • Changed mode installation for Alpha 6.2b6 Tcl reorganization.
  285. • Created command history window.
  286. • Renamed more procedures to be more consistent.
  287. • Created mode variables for special window names.
  288. • Added openErrorFile
  289.  
  290.                Changes in Version 1.2
  291.  
  292. • Added control option to DblClickEdits (Requires Alpha 6.04)
  293. • MATLMenu  "•405" now an Alpha resource
  294. • Got rid of MATc mode
  295. • Added matHelp
  296. • Turned on shell flag of command window
  297. • Added matDummyMenuItem proc so users can add items easily to MATLMenu
  298. • Added workspace and debug submenus
  299. • Created matlabMode.tcl so tclIndexes can be used
  300.  
  301.                Changes in Version 1.1
  302.  
  303. • Added cmd-double clicking code by Tom Pollard
  304. • cleaned up prompting in command window
  305. • Removed "redundant" do's from menu
  306. • Open selection now opens associated m-files if selection is a .mex
  307. • Fixed up command line recall
  308.  
  309.                Changes in Version 1.0.1
  310.  
  311. • Fixed a bug in matlabCarriageReturn
  312.  
  313.                Changes in Version 1.0
  314.  
  315. • Added openSelection
  316. • Added command line recall in command window
  317. • Fixed doLine
  318. • Changed key bindings and put some in menu
  319.  
  320.  
  321.     ----------------------------------------------------------------------
  322.  
  323.           To Do:
  324.  
  325.  
  326. • Insert comment above command line for dbstep in command window
  327. • Add check for error from MATLAB on debugging procs
  328. • Workspace list window
  329. • Help Browser
  330. • "Word completion" in command window
  331. • Loop thru lines in multi-line sends
  332.   
  333.  
  334.     ----------------------------------------------------------------------
  335.  
  336.           Signature
  337.  
  338.  
  339. This mode was written by Stephen Merkowitz.  Some code was stolen from other
  340. TCL files distributed with Alpha (mostly "shell.tcl").  Thanks to Tom Pollard
  341. who gave me cmd-double clicking code along with other fixes.  Comments,
  342. suggestions, and bug reports should be sent to Stephen at
  343. <Stephen.Merkowitz@lnf.infn.it>.
  344.  
  345. You should be able to find the most recent version of MATLAB mode at 
  346. <http://phwave.phys.lsu.edu/~merkowitz/alpha/>
  347.  
  348. If you would like to be notified of new releases of MATLAB mode send mail 
  349. to Stephen at <Stephen.Merkowitz@lnf.infn.it>.
  350.  
  351.